package src.java.easy;

public class Solution26 {
    public int removeDuplicates(int[] nums) {
        int left = 0;
        int right = 1;
        while (right < nums.length) {
        if(nums[right]==nums[left]){
            right++;
        }else {
            nums[left+1]=nums[right];
            left++;
            right++;
        }
        }
        return left+1;
    }
}
